package net.dethnull.joscontrol.parse;

/**
 * User: Dethnull
 * Date: 2/3/13
 * Time: 7:28 PM
 * Description:
 * This class holds static methods for converting incoming letters to the appropriate int value
 * set by the constants of KeyEvent in the awt package
 */
public class ParseKey {

    public static int character2Integer(char letter) {
        int returnInt = 0;
        switch (letter) {
            case '0':
                returnInt = 48;
                break;
            case '1':
                returnInt = 49;
                break;
            case '2':
                returnInt = 50;
                break;
            case '3':
                returnInt = 51;
                break;
            case '4':
                returnInt = 52;
                break;
            case '5':
                returnInt = 53;
                break;
            case '6':
                returnInt = 54;
                break;
            case '7':
                returnInt = 55;
                break;
            case '8':
                returnInt = 56;
                break;
            case '9':
                returnInt = 57;
                break;
            case 'a':
                returnInt = 65;
                break;
            case 'b':
                returnInt = 66;
                break;
            case 'c':
                returnInt = 67;
                break;
            case 'd':
                returnInt = 68;
                break;
            case 'e':
                returnInt = 69;
                break;
            case 'f':
                returnInt = 70;
                break;
            case 'g':
                returnInt = 71;
                break;
            case 'h':
                returnInt = 72;
                break;
            case 'i':
                returnInt = 73;
                break;
            case 'j':
                returnInt = 74;
                break;
            case 'k':
                returnInt = 75;
                break;
            case 'l':
                returnInt = 76;
                break;
            case 'm':
                returnInt = 77;
                break;
            case 'n':
                returnInt = 78;
                break;
            case 'o':
                returnInt = 79;
                break;
            case 'p':
                returnInt = 80;
                break;
            case 'q':
                returnInt = 81;
                break;
            case 'r':
                returnInt = 82;
                break;
            case 's':
                returnInt = 83;
                break;
            case 't':
                returnInt = 84;
                break;
            case 'u':
                returnInt = 85;
                break;
            case 'v':
                returnInt = 86;
                break;
            case 'w':
                returnInt = 87;
                break;
            case 'x':
                returnInt = 88;
                break;
            case 'y':
                returnInt = 89;
                break;
            case 'z':
                returnInt = 90;
                break;
            default:
                break;

        }
        return returnInt;
    }

}
